﻿#ifndef PAGE4_H
#define PAGE4_H

#include <QWidget>
#include <QPushButton>
#include <QTableView>
#include <QLabel>
#include <QString>
#include <QVBoxLayout>
#include <QMap>
#include <QPair>
#include <QDate>
#include <QSqlTableModel>
#include <QSqlRecord>
#include <QtCharts/QChartView>
#include <QtCharts/QBarSeries>
#include <QtCharts/QBarSet>
#include <QtCharts/QBarCategoryAxis>
#include <QtCharts/QValueAxis>
#include <QComboBox>
#include <QtCharts>

using namespace QtCharts;

class Page4 : public QWidget
{
    Q_OBJECT

public:
    explicit Page4(QWidget* parent = nullptr);
    ~Page4();

signals:
    void nextPageRequested();
    void orderRequested();
    void productionRequested();
    void storeRequested();
    void financeRequested();
    void addEmployeeRequested();
    void pageRequested10();
void pageRequested13();
    void pageRequested1();

public slots:
    void financeHide();
    void signuphide();
    void generateQuarterlyReport();
      void onFrontButtonClicked();

private:
    QPushButton* orderButton;          // 订单按钮
    QPushButton* warehouseButton;      // 仓库按钮
    QPushButton* productionButton;     // 生产按钮
    QPushButton* financeButton;        // 财务按钮
    QTableView* tableView;
    QLabel* productionProgressLabel;
    QPushButton*emptyButton;
    QPushButton* addEmployeeButton;
    QPushButton* helpButton;
    QPushButton*connectButton;//连接按钮
    int getQuarterFromDate(const QDate &date);
    QVBoxLayout *mainLayout;
    QtCharts::QChart *chart;
    QtCharts::QChartView *chartView;
    QMap<QString, QPair<int, int>> quarterlyData;
    QComboBox *yearComboBox;
    void clearOldChart();
        QPushButton*frontButton;
};

#endif // PAGE4_H
